package kr.hkit.powerjava.chapter14; //345p LAB

import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.HeadlessException;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

class MyLab extends JFrame {
	JPanel p1;

	public MyLab() throws HeadlessException {
		setSize(300, 200);
		setTitle("My Lab 345p");
		p1 = new JPanel();
		p1.setLayout(new GridLayout(0,4));
		for (int i = 0 ; i< 10; i++) { //for문으로 동일이름 반복생성
			p1.add(new JButton("Button" + i));
		}
		add(p1); //프레임에 패널담기
//		pack();
		setVisible(true);
	}
}

public class LabTest {
	public static void main(String[] args) {
		new MyLab();
	}
}
